<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;
use LowCode\Traits\Props\HasColor;

/**
 * Svg图标组件
 * @method static static make(mixed $children = null) Svg图标组件
 */
class IconWrapper extends Naive
{

    use HasColor;


    /**
     * @param mixed|null $children
     */
    public function __construct(mixed $children = null)
    {
        parent::__construct();
        $this->children($children);
    }

    /**
     * 颜色
     * @param string|JsExp $color
     * @return $this
     */
    public function iconColor(string|JsExp $color): static
    {
        return $this->prop('icon-color', $color);
    }


    /**
     * 设置图标大小
     * @param int|string|JsExp $size
     * @return $this
     */
    public function size(int|string|JsExp $size): static
    {
        return $this->prop("size", $size);
    }

    /**
     * 边框圆角大小
     * @param int|string|JsExp $value
     * @return $this
     */
    public function borderRadius(int|string|JsExp $value = 6): static
    {
        return $this->prop("border-radius", $value);
    }
}
